package com.lhkj.ct.meta.modules.psychology.model.dto;

import com.lhkj.ct.base.validator.constraints.HasNonElement;
import com.lhkj.ct.base.validator.group.ValGroups;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;
import java.util.Set;

/**
 * <p>
 *     分配传参类
 * </p>
 */
@Setter
@Getter
public class GaugeAllotDto implements Serializable {

    @ApiModelProperty(value = "测验开始时间", notes = "测验分配")
    private Date startTime;

    @ApiModelProperty(value = "测验结束时间", notes = "测验分配")
    private Date closingTime;

    @ApiModelProperty(value = "测验类型", notes = "测验分配:1.日常测验 2.普测")
    @NotNull(message = "请选择测验类型", groups = {Scale.class})
    private Integer psyType;

    @ApiModelProperty(value = "开单医生(工号)", notes = "测验分配")
    private String billDoctor;

    @ApiModelProperty(value = "开单科室", notes = "测验分配")
    private String billDept;

    @ApiModelProperty(value = "开单时间", notes = "测验分配")
    private LocalDateTime billTime;

//    @ApiModelProperty(value = "开单机构")
//    private String billOrgan;

    @ApiModelProperty(value = "执行人", notes = "测验分配")
    private String executor;

    @ApiModelProperty(value = "是否匿名", notes = "问卷分配")
    @NotNull(message = "请选择是否匿名", groups = {Qnr.class})
    private Boolean anonymous;

    @NotNull(message = "量表id不能为null", groups = {Scale.class})
    @NotEmpty(message = "请选择需要分配的量表", groups = {Qnr.class})
    @HasNonElement(message = "不能包含null的量表id", groups = {ValGroups.Insert.class})
    @ApiModelProperty(value = "量表id", notes = "量表分配时，量表或组套必传其中之一;问卷分配必传")
    private Set<String> scaleIds;

    @NotNull(message = "测验组套id不能为null", groups = {Scale.class})
    @HasNonElement(message = "不能包含null的组套id", groups = {Scale.class})
    @ApiModelProperty(value = "测验组套", notes = "量表分配时，量表或组套必传其中之一")
    private Set<String> scaleSets;

    @NotNull(message = "团体不能为NULL", groups = {Scale.class, Qnr.class})
    @ApiModelProperty(value = "单位id")
    private List<String> unitIds;

    @NotNull(message = "档案标签不能为NULL", groups = {Scale.class, Qnr.class})
    @ApiModelProperty(value = "标签id")
    private List<String> patLabelIds;

    @NotNull(message = "档案id不能为NULL", groups = {Scale.class, Qnr.class})
    @ApiModelProperty(value = "按档案")
    private List<String> patIds;

    public interface Scale {

    }

    public interface Qnr {

    }
}
